<%-- 
    Document   : doctor
    Created on : May 23, 2011, 7:23:23 PM
    Author     : suraj
--%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<br/>
<br/>

<logic:equal value="view" parameter="entityAction">
    <bean:define id="readOnly" value="true"/>
</logic:equal>
<logic:notEqual value="view" parameter="entityAction">
    <bean:define id="readOnly" value="false"/>
</logic:notEqual>

<html:form action="/doctorAction">
    
    <table id="cas-form-table"> 
        <caption>Doctor Details</caption> 
        <colgroup>
            <col class="cas-form-table-label-column" />
            <col/>
        </colgroup>
        <thead>
            <tr>
                <th scope="col"></th>
                <th scope="col"></th>
            </tr>
        </thead>
        <tbody> 
        
            <logic:notEqual value="add" parameter="entityAction">
            <tr>  
                <td>ID</td>  
                <td><html:text property="id" readonly="true" /></td>  
            </tr>  
            </logic:notEqual>
            <tr>  
                <td>First Name</td>  
                <td>
                    <html:text property="firstName" readonly="${readOnly}" />
                    <logic:messagesPresent>
                        <span style="color: #f00"> 
                            <html:messages id="msg" property="firstName">
                                <bean:write name="msg" />
                            </html:messages>
                        </span>
                    </logic:messagesPresent>
                </td>
            </tr>  
            <tr>  
                <td>Second Name</td>  
                <td><html:text property="secondName" readonly="${readOnly}" /></td>
            </tr>  
            <tr>  
                <td>Family Name</td>  
                <td><html:text property="familyName" readonly="${readOnly}" /></td>
            </tr>  
            <tr>  
                <td>Sex</td>  
                <td>
                    <html:radio property="sex" value="1" disabled="${readOnly}">Male</html:radio>
                    <html:radio property="sex" value="2" disabled="${readOnly}">Female</html:radio>
                </td>  
            </tr>  
            <tr >  
                <td>Speciality</td>  
                <td><html:text property="speciality" readonly="${readOnly}" /></td>  
            </tr>  
        </tbody>
    </table>
                <br/></br>
                <html:hidden property="entityAction" />
                <html:submit value=" O K "/>
                <html:cancel value="Cancel"/>
</html:form>
<br/>
<br/>
